package org.fastsyncer.connector.common;

import java.util.HashMap;

public class DatabaseConstant {

	/**
	 * SQL插入
	 */
	public static final String OPERTION_SQL_INSERT = "insert";
	
	/**
	 * SQL更新
	 */
	public static final String OPERTION_SQL_UPDATE = "update";
	
	/**
	 * SQL删除
	 */
	public static final String OPERTION_SQL_DELETE = "delete";
	
	/**
	 * SQL查询
	 */
	public static final String OPERTION_SQL_QUERY = "query";
	
	/**
	 * SQL查询and
	 */
	public static final String OPERTION_SQL_QUERY_AND = "and";
	
	/**
	 * SQL查询or
	 */
	public static final String OPERTION_SQL_QUERY_OR = "or";

	/**
	 * Mysql分页语句
	 */
	public static final String DB_MYSQL_PAGE_SQL = " LIMIT ?,?";
	
	/**
	 * Mysql分页语句空
	 */
	public static final String DB_MYSQL_PAGE_SQL_NULL = " LIMIT 0";
	
	/**
	 * Mysql驱动
	 */
	public static final String DB_MYSQL_DRIVER_CLASSNAME = "com.mysql.jdbc.Driver";

	/**
	 * Oracle分页语句开始
	 */
	public static final String DB_ORACLE_PAGE_SQL_START = "SELECT * FROM (SELECT A.*, ROWNUM RN FROM (";
	
	/**
	 * Oracle分页语句结束
	 */
	public static final String DB_ORACLE_PAGE_SQL_END = ")A WHERE ROWNUM <= ?) WHERE RN > ?";
	
	/**
	 * Oracle分页语句空
	 */
	public static final String DB_ORACLE_PAGE_SQL_NULL = " WHERE ROWNUM = 0";
	
	/**
	 * Oracle驱动
	 */
	public static final String DB_ORACLE_DRIVER_CLASSNAME = "oracle.jdbc.OracleDriver";
	
	/**
	 * 查询表达式
	 */
	public static final HashMap<String, String> OPERS = new HashMap<String, String>();
	
	static {
		OPERS.put("equal", "=");
		OPERS.put("notEqual", "!=");
		OPERS.put("gt", ">");
		OPERS.put("lt", "<");
		OPERS.put("gtAndEqual", ">=");
		OPERS.put("ltAndEqual", "<=");
	}
	
}
